<include file="Common:minheader" />
<!-- /. NAV SIDE  -->
<style>
	.hg{
		height:30px;
		line-height:30px;
	}
	.title{
		margin-top:30px;
	}
</style>
<div class="panel-body">
	<div class="layui-fluid">
	    <div class="layui-row">
			<b>商品信息</b><hr>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr class="table_data_title" style="border-bottom:1px soild #CCCCCC"> 
                   <td align="left">图片</td><td align="left">商品名</td> <td  align="left">规格</td></tr>
                <tr>
				<tr>
					<td align="left"><img src="{$info.goods_img_url}" border="0" width="50" /></td>
					<td align="left">{$info.goods_title}</td>
					<td align="left" style="padding:5px 0 5px;">{$info.goods_spec}</td>
				</tr>
            </table>
		</div>
		<div class="layui-row" style="margin-top:20px">
			<b>评价信息</b><hr>
			<div class="layui-col-xs12 layui-col-sm12 layui-col-md12 hg">
				商品评价：{$info.evaluate}
			</div>
			<div class="layui-col-xs12 layui-col-sm12 layui-col-md12 hg">
				评价内容：{$info.content}
			</div>
		</div>
		<div class="layui-row" style="margin-top:20px">
			<b>综合评分</b><hr>
			<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 hg">
				商品：{$info.level1}
			</div>
			<!--<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 hg">-->
			<!--	物流：{$info.level2}-->
			<!--</div>-->
			<!--<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 hg">-->
			<!--	服务：{$info.level3}-->
			<!--</div>-->
		</div>
		<div class="layui-row" style="margin-top:20px">
			<b>评价图片</b><hr>
			<volist name="imageList" id="vo">
			    <div class="layui-inline" style="margin-right:10px"><a href="{$vo}" target="_blank"><img src="{$vo}" border="0" width="100" /></a></div>
			</volist>
		</div>
		<if condition="!empty($info['reply_time'])">
		    <div class="layui-row" style="margin-top:20px">
    			<b>回复结果</b><hr>
    			<div class="layui-col-xs12 layui-col-sm12 layui-col-md12 hg">
    				状态：<if condition="$info.status eq 1">已审核<elseif condition="$info.status eq 2" />审核未通过<else />待审核</if>
    			</div>
    			<div class="layui-col-xs12 layui-col-sm12 layui-col-md12 hg">
    				内容：<if condition="$info.status eq 1">{$info.reply_content}<else />{$info.op_memo}</if>
    			</div>
    		</div>
		</if>
	</div>
</div>
<hr>
<div style="margin-top:20px;">
	<form class="layui-form" action="">
		<input type="hidden" name="id" value="{$info.id}">
		<div class="layui-form-item">
			<label class="layui-form-label">是否通过：</label>
			<div class="layui-input-block">
				<select name="auitSelect" lay-verify="required" lay-filter="auitSelect">
					<option value="">请选择</option>
					<notempty name="auitSelectList">
						<volist name="auitSelectList" id="vo">
							<option value="{$vo.value}">{$vo.name}</option>
						</volist>
					</notempty>
				</select>
			</div>
		</div>
		<div class="layui-form-item" id="replay">
			<label class="layui-form-label">回复内容：</label>
			<div class="layui-input-block">
			  <textarea name="reply_content" placeholder="请输入回复内容" class="layui-textarea"></textarea>
			</div>
		</div>
		<div class="layui-form-item" id="reason" style="display:none">
			<label class="layui-form-label">原因：</label>
			<div class="layui-input-block">
				<input type="text" name="reason" required  lay-verify="" placeholder="请输入审核不通过原因" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item" style="padding-bottom:50px">
			<div class="layui-input-block">
			  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
			  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	layui.use('form', function(){
	  var form = layui.form;
	  //监听提交
	  form.on('select(auitSelect)',function(data){ //
			var val = data.value;
			$('#replay').show();
			$('#reason').hide();
			if(val==2){
			    $('#replay').hide();
				$('#reason').show();
			}
	  });
	  form.on('submit(formDemo)', function(data){
			var cont = data.field;
			$.ajax({
				url:"{:U('Goods/auitGoodsComment')}",
				type:'post',
				dataType:'json',
				data:cont,
				success:function(data){
					if(data.code==0){
						layer.alert(data.message);
					}else{
						layer.alert(data.message, function(index){
							//do something
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name); 
							parent.layer.close(index);
						});
					}
				}
			});
			//layer.msg(JSON.stringify(data.field));
			return false;
	  });
	});
</script>
<!-- /. PAGE INNER  -->
<include file="Common:footer" />